import torch
import numpy as np
import torch.optim as optim
import torch.nn as nn


# 定义一个简单的神经网络
class SimpleNN(nn.Module):
    def __init__(self):
        super(SimpleNN, self).__init__()
        # 定义一个输入层到隐藏层的全连接层
        self.fc1 = nn.Linear(1, 10)
        # 定义一个隐藏层到输出层的全连接层
        self.fc2 = nn.Linear(10, 1)

    def forward(self, x):
        # 前向传播过程
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x


# 主函数
if __name__ == '__main__':
    # 创建模型实例
    model = SimpleNN()
    x = torch.tensor([[1.0]])
    print(model(x))
    # print(model)
